$('.d-banner-close').click(function() {
    $('.d-banner-close').parents('.d-banner').hide()
});

// a标签变色
$('.d-head1 a').hover(function() {
        $(this).css('color', 'red');
        $('.d-common-catA').css('color', 'white');
        $('.d-notbs').css('color', '#8C8C8C');
    }, function() {
        $(this).css('color', '');
        $('.d-notbs').css('color', '#8C8C8C')

    })
    // 地区隐藏
$('.d-headCity').hover(function() {
        $('.d-headCityYc').show();
        $('.d-headCity').css({
            'border': '1px solid #d2d2d2',
            'background-color': 'white'
        })
    }, function() {
        $('.d-headCityYc').hide();
        $('.d-headCity').css({
            'border': '',
            'background-color': ''
        })
    })
    // 购物车隐藏
$('.d-headshopCar').hover(function() {
        $('.d-headshopCar-yc').show();
        $('.d-headshopCarAA').css({
            'border-bottom': '1px solid #fff'
        })
    }, function() {
        $('.d-headshopCar-yc').hide();
        $('.d-headshopCarAA').css({
            'border-bottom': ''
        })
    })
    // 网站导航隐藏
$('.d-headNav-right-lastli').hover(function() {
    $('.d-headNav-lastli-div2YC').show();
    $('.d-headNav-right-lastli').css({
        'border': '1px solid #d2d2d2',
        'background-color': 'white'
    })
}, function() {
    $('.d-headNav-lastli-div2YC').hide();
    $('.d-headNav-right-lastli').css({
        'border': '',
        'background-color': ''
    })
})




$(window).scroll(function() {
    // 获取banner距离上方的偏移
    var dbannerTop = $('.d-head-nav-all').offset().top;
    if ($(window).scrollTop() >= dbannerTop) {
        $('.d-head-YCtop').fadeIn(500);
    } else {
        $('.d-head-YCtop').fadeOut(500);
    }
});


var data = beautifulLi.getCityData('index');
var dabc = document.querySelector('.d-abc')
var dheadCityUl = document.querySelector('.d-headCityUl');
data.forEach(function(i) {
    var aA = document.createElement('a');
    aA.className = 'd-aa'
    aA.href = '###'
    aA.innerText = i.name;
    dabc.append(aA);

    var ctiyli = document.createElement('li');

    var cityEm = document.createElement('em');
    cityEm.innerText = i.name;
    ctiyli.append(cityEm);


    var ctiyDiv = document.createElement('div');
    ctiyDiv.className = "d-emdiv"

    var datacity = i.data;
    for (var j = 0; j < datacity.length; j++) {



        var ctiyA = document.createElement('a');
        ctiyA.innerText = datacity[j];
        ctiyDiv.append(ctiyA);


        ctiyli.append(ctiyDiv);
        dheadCityUl.append(ctiyli);
    };

});